package cn.edu.scnu.mapper;

import cn.edu.scnu.entity.MovieStats;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MovieStatsMapper extends BaseMapper<MovieStats> {
    @Select("SELECT * FROM movie_stats WHERE movie_id = #{movieId}")
    MovieStats selectByMovieId(String movieId);

    @Select("SELECT * FROM movie_stats ORDER BY weekly_views DESC")
    List<MovieStats> selectWeeklyViewsData();

    @Select("SELECT * FROM movie_stats ORDER BY monthly_views DESC")
    List<MovieStats> selectMonthlyViewsData();
}
